<!DOCTYPE html>
<html dir="<?php echo $direction; ?>" lang="<?php echo $lang; ?>">
<head>
	<meta charset="UTF-8" />
	<!-- Set the viewport width to device width for mobile -->
	<meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1.0, maximum-scale=1.0" />
	<title><?php echo $title; ?></title>
	<base href="<?php echo $base; ?>" />
	<?php if ($description) { ?>
	<meta name="description" content="<?php echo $description; ?>" />
	<?php } ?>
	<?php if ($keywords) { ?>
	<meta name="keywords" content="<?php echo $keywords; ?>" />
	<?php } ?>
	<?php if ($icon) { ?>
	<link href="<?php echo $icon; ?>" rel="icon" />
	<?php } ?>
	<?php foreach ($links as $link) { ?>
	<link href="<?php echo $link['href']; ?>" rel="<?php echo $link['rel']; ?>" />
	<?php } ?>
	<!-- Style Files -->
    <link href="http://fonts.googleapis.com/css?family=Open+Sans:400,300,300italic,400italic,600,700,700italic,800" rel="stylesheet" type="text/css">  
	<link rel="stylesheet" href="catalog/view/theme/bistro/layerslider/css/layerslider.css" type="text/css">
	<link rel="stylesheet" href="catalog/view/theme/bistro/css/bootstrap.css">
	<link rel="stylesheet" href="catalog/view/theme/bistro/css/media.css">
	<link rel="stylesheet" href="catalog/view/theme/bistro/css/flexslider.css">
	<link rel="stylesheet" href="catalog/view/theme/bistro/style.css">
	<link rel="stylesheet" href="catalog/view/theme/bistro/layerslider/skins/fullwidth/skin.css" type="text/css">
	<?php foreach ($styles as $style) { ?>
	<link rel="<?php echo $style['rel']; ?>" type="text/css" href="<?php echo $style['href']; ?>" media="<?php echo $style['media']; ?>" />
	<?php } ?>
	<script type="text/javascript" src="catalog/view/javascript/jquery/jquery-1.7.2.min.js"></script>
	<script src="catalog/view/theme/bistro/js/jquery-easing-1.3.js" type="text/javascript"></script>
	<script src="catalog/view/theme/bistro/js/jquery-transit-modified.js" type="text/javascript"></script>
	<script src="catalog/view/theme/bistro/layerslider/js/layerslider.transitions.js" type="text/javascript"></script>
	<script src="catalog/view/theme/bistro/layerslider/js/layerslider.kreaturamedia.jquery.js" type="text/javascript"></script> 
	<script src="catalog/view/theme/bistro/js/bootstrap.min.js"></script>
	<script src="catalog/view/theme/bistro/js/jquery.flexslider.min.js"></script>
	<script src="catalog/view/theme/bistro/js/countdown.js"></script>
	<script src="catalog/view/theme/bistro/js/jflickrfeed.min.js"></script>
	<?php foreach ($scripts as $script) { ?>
	<script type="text/javascript" src="<?php echo $script; ?>"></script>
	<?php } ?>
	<!--[if IE 7]>
		<link rel="stylesheet" href="catalog/view/theme/bistro/css/font-awesome-ie7.min.css">
	<![endif]-->  

	<!-- JS Files -->
	<script>
		document.documentElement.className = document.documentElement.className.replace(/(\s|^)no-js(\s|$)/, '$1js$2');
	</script>
    
     <!--[if lt IE 9]>
		<script src="catalog/view/theme/bistro/js/html5shiv.min.js"></script>
	<![endif]--> 
	<?php echo $google_analytics; ?>
</head>
<body>

	<!-- Start Top Bar -->
    <div class="container tophead">
    	<div class="left span3">
        	<ul class="social">
					<?php if ($this->config->get('tg_bistro_footer_facebook_show') == "1") { ?>
		        	<li>
					
						<a title="<?php echo $this->config->get('tg_bistro_footer_html_facebook_title' . $this->config->get('config_language_id')); ?>" data-placement="bottom" data-toggle="tooltip" href="https://facebook.com/<?php echo $this->config->get('tg_bistro_footer_facebook'); ?>" target="_blank"><i class="icon-facebook"></i>
						</a>
					
					</li>
		      		<?php } ?>
					
					<?php if ($this->config->get('tg_bistro_footer_twitter_show') == "1") { ?>
					<li>
						  <a title="<?php echo $this->config->get('tg_bistro_footer_html_twitter_title' . $this->config->get('config_language_id')); ?>" data-placement="bottom" data-toggle="tooltip" href="https://twitter.com/#!/<?php echo $this->config->get('tg_bistro_footer_twitter'); ?>" target="_blank"><i class="icon-twitter"></i>
						  </a>
					</li>
		      		<?php } ?>
					
					<?php if ($this->config->get('tg_bistro_footer_googleplus_show') == "1") { ?>
					<li>
						<a title="<?php echo $this->config->get('tg_bistro_footer_html_googleplus_title' . $this->config->get('config_language_id')); ?>" data-placement="bottom" data-toggle="tooltip"  href="https://plus.google.com/u/0/<?php echo $this->config->get('tg_bistro_footer_googleplus'); ?>" target="_blank"><i class="icon-google-plus"></i>
							</a>	
					</li>		 
		      		<?php } ?>
					
					<?php if ($this->config->get('tg_bistro_footer_pinterest_show') == "1") { ?>
					<li>
						  <a title="<?php echo $this->config->get('tg_bistro_footer_html_pinterest_title' . $this->config->get('config_language_id')); ?>" data-placement="bottom" data-toggle="tooltip" href="https://pinterest.com/<?php echo $this->config->get('tg_bistro_footer_pinterest'); ?>" target="_blank"><i class="icon-pinterest"></i>
						  	</a> 
					</li>
		      		<?php } ?>
					
					<?php if ($this->config->get('tg_bistro_footer_youtube_show') == "1") { ?>
					<li>
						 <a title="<?php echo $this->config->get('tg_bistro_footer_html_youtube_title' . $this->config->get('config_language_id')); ?>" data-placement="bottom" data-toggle="tooltip" href="https://youtube.com/<?php echo $this->config->get('tg_bistro_footer_youtube'); ?>" target="_blank"><i class="icon-xing"></i>
							</a>			
				
					</li>	  
		      		<?php } ?>
            </ul>
        </div>
        <div class="right">
                <div id="wdt-links">
                    <ul>
                    	<?php echo $cart; ?>
                    	<?php if(!$logged){ ?>
                        <li class="register"><a href="<?php echo $register; ?>" id="wdt-register">Register <i class="icon-user"></i></a></li>
                        <li><a href="<?php echo $login; ?>">Login <i class="icon-unlock-alt"></i></a></li>
                        <?php }else{ ?>
                         <li class="register"><a href="<?php echo $account; ?>" id="wdt-register">Account <i class="icon-user"></i></a></li>
                        <li><a href="<?php echo $logout; ?>">Logout <i class="icon-unlock-alt"></i></a></li>
                        <?php } ?>
                    </ul>
                </div>
            </div>
        </div>
	<!-- END Top Bar -->

    <!-- Start Header Bar -->
    <div class="container header-wrap make-bg">
		<div class="left brand">
           <h1><a href="<?php echo HTTP_SERVER; ?>">Bistro</a></h1>
        </div>
        <div class="right">
        	<div class="searchbar span3">
                <form class="form-search">
              <input type="text" placeholder="Search 10.000+ items from 1000+ stores" data-provide="typeahead" data-items="4" data-source='["Alabama","Alaska","Arizona","Arkansas","California","Colorado","Connecticut","Delaware","Florida","Georgia","Hawaii","Idaho","Illinois","Indiana","Iowa","Kansas","Kentucky","Louisiana","Maine","Maryland","Massachusetts","Michigan","Minnesota","Mississippi","Missouri","Montana","Nebraska","Nevada","New Hampshire","New Jersey","New Mexico","New York","North Dakota","North Carolina","Ohio","Oklahoma","Oregon","Pennsylvania","Rhode Island","South Carolina","South Dakota","Tennessee","Texas","Utah","Vermont","Virginia","Washington","West Virginia","Wisconsin","Wyoming"]'>
                </form>
		    </div>
		</div>
	</div>
        
    <div class="container make-bg">
	<div class="navbar">
		<div class="container">
			<div class="navbar-inner">
                <button class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
                  <span class="icon-bar"></span>
                  <span class="icon-bar"></span>
                  <span class="icon-bar"></span>
                </button>
		<div class="nav-collapse collapse">
			<ul class="nav pull-left">
				<li class="active"><a href="<?php echo HTTP_SERVER; ?>">Home</a></li>
				<li class="dropdown dropdown-hover">
                  <a class="dropdown-toggle" href="#" data-toggle="dropdown">Categories <span class="caret"></span></a>
                      <div class="dropdown-menu span4">
                        <div class="row">
                        <?php $count = count($categories); ?> 
                        <div class="span2">
                            <ul class="mega-menu-links">
	                        <?php foreach ($categories as $key=>$category) { if($key > $count/2) continue; ?> 
						        <li>
						          <a href="<?php echo $category['href']; ?>"><?php echo $category['name']; ?></a>
						        </li> 
					        <?php } ?>  
                            </ul>
                          </div>
                          <div class="span2">
                            <ul class="mega-menu-links">
	                        <?php foreach ($categories as $key=>$category) { if($key <= $count/2) continue; ?> 
						        <li>
						          <a href="<?php echo $category['href']; ?>"><?php echo $category['name']; ?></a>
						        </li> 
					        <?php } ?>  
                            </ul>
                          </div>
					   </div>
					</div>
                </li>
				<li class="dropdown dropdown-hover">
					<a href="#" class="dropdown-toggle" data-toggle="dropdown">THE DEAL <span class="caret"></span></a>
                        <div class="dropdown-menu span8">
                          <ul class="thumbnails">
                          	<?php foreach($products as $row){ ?>
                            <li class="span2">
                                <div class="wdt-product">
                                    <div class="wdt-products-wrapper">
                                        <div class="wdt-product active show">
                                            <a href="<?php echo $row['href'] ?>" title="<?php echo $row['name'] ?>">
                                                <img src="<?php echo $row['thumb'] ?>" alt="<?php echo $row['name'] ?>" />
                                            </a>
                                            <h4><a href="<?php echo $row['href'] ?>" title="<?php echo $row['name'] ?>"><?php echo $row['name'] ?></a></h4>
                                            <ul class="rating">
                                                <?php for($i=1;$i<=5;$i++){ ?>
	                                                <?php if($i<=(int)$row['rating']){ ?>
	                                                <li><i class="star-on"></i></li>
	                                                <?php } else{ ?>
                                                	<li><i class="star-off"></i></li>
	                                                <?php } ?>
                                                <?php } ?>
                                            </ul>
                                                <div class="wdt-pricing">
                                                    <a href="<?php echo $row['href'] ?>" title="<?php echo $row['name'] ?>"><span class="amount"><?php echo $row['price'] ?></span></a>
                                                </div>
											<div class="wdt-cart">
												<div class="wdt-cart-bar">
													<a href="javascript:;" onclick="addToCart('<?php echo $row['product_id']; ?>');" title="<?php echo $row['name'] ?>"><i class="icon-shopping-cart"></i> Add to basket</a>
												</div>
											</div>
											<div class="wdt-overlay">
												<a href="<?php echo $row['href'] ?>" title="<?php echo $row['name'] ?>"><span class="amount"><?php echo $row['price'] ?></span></a>
											</div>
                                        </div>
                                    </div>
                                </div>
                            </li>
                            <?php } ?>
                          </ul>
                        </div><!-- .dropdown-menu -->
                      </li>
                       <li class="dropdown dropdown-hover">
                          <a class="dropdown-toggle" href="#" data-toggle="dropdown">Features <span class="caret"></span></a>
                          <div class="dropdown-menu span6">
                            <div class="row">
                             <?php $count = count($news); ?> 
	                          <div class="span2">
	                            <ul class="mega-menu-links">
		                        <?php foreach ($news as $key=>$value) { if($key >= $count/3) continue; ?> 
							        <li>
							          <a href="<?php echo $value['href']; ?>"><?php echo $value['name']; ?></a>
							        </li> 
						        <?php } ?>  
	                            </ul>
	                          </div>
	                          <div class="span2">
	                            <ul class="mega-menu-links">
		                        <?php foreach ($news as $key=>$value) { if($key < $count/3 || $key >= 2*$count/3) continue; ?> 
							        <li>
							          <a href="<?php echo $value['href']; ?>"><?php echo $value['name']; ?></a>
							        </li> 
						        <?php } ?>  
	                            </ul>
	                          </div>
	                          <div class="span2">
	                            <ul class="mega-menu-links">
		                        <?php foreach ($news as $key=>$value) { if($key < 2*$count/3) continue; ?> 
							        <li>
							          <a href="<?php echo $value['href']; ?>"><?php echo $value['name']; ?></a>
							        </li> 
						        <?php } ?>  
	                            </ul>
	                          </div>
                            </div>
                          </div>
                        </li>
                        <li><a href="<?php echo $blog; ?>">Blog</a></li>
                        <li><a href="<?php echo $shopping_cart; ?>">Shopping Cart</a></li>
                        <li><a href="<?php echo $checkout; ?>">Checkout</a></li>
                        <li><a href="<?php echo $contact; ?>">Contact</a></li>
                      </ul>
                      <?php if($logged){ ?>
                        <ul class="nav pull-right">
	                      <li class="dropdown dropdown-hover">
	                          <a class="dropdown-toggle" href="#" data-toggle="dropdown"><?php echo $username ?> CP <span class="caret"></span></a>
	                          <div class="dropdown-menu span4">
	                            <div class="row">
	                              <div class="span2">
	                                <p>Welcome back <strong><?php echo $username ?>!</strong></p>
	                                <p>If you need any help please contact us via <a href="#">ticket system</a> in your dashboard.</p>
	                              </div>
	                              <div class="span2">
	                                <ul class="mega-menu-links">
	                                  <li><a href="<?php echo $wishlist; ?>">Wishlist</a></li>
	                                  <li><a href="<?php echo $account; ?>">My Account</a></li>
	                                  <li><a href="<?php echo $shopping_cart; ?>">Shopping Cart</a></li>
	                                  <li><a href="<?php echo $checkout; ?>">Checkout</a></li>
	                                  <li><a href="#">My Tickets</a></li>
	                                </ul>
	                              </div>
	                            </div>
	                          </div>
	                        </li>
	                    </ul>
	                    <?php } ?>
                </div>
			</div>
		</div>
	</div>
</div>
	<!-- END Header Bar -->
<!--<div class="container make-bg">
	<div class="row">
		<div class="span12">
			<div id="notification"></div>
	    </div>
	</div>
</div>-->
